package com.gaoboy.springbootgoods.controller;

import com.gaoboy.springbootgoods.entity.OrderItem;
import com.gaoboy.springbootgoods.service.OrderItemService;
import com.gaoboy.springbootgoods.vo.OrderItemVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@Controller
public class OrderItemColler {

    @Autowired
    private OrderItemService orderItemService;

    @RequestMapping("orderitem")
    public String queryByOrderNum(String orderNum, HttpServletRequest request){
        List<OrderItemVo> orderItemVos = orderItemService.queryByOrderNum(orderNum);

        request.setAttribute("orderItemVos",orderItemVos);
        System.out.println(orderItemVos.toString());
        return "orderitemlist";
    }
}
